package com.hashimoto.core.remote.subscribe;

import java.util.ArrayList;
import java.util.List;

import com.hashimoto.core.message.EdgeInitiativePushSignal;

public class EventSubject implements Subject<EdgeInitiativePushSignal> {
		
	private List<Observer<? super EdgeInitiativePushSignal>> obsevers = new ArrayList<Observer<? super EdgeInitiativePushSignal>>();

	@Override
	public void attach(Observer<? super EdgeInitiativePushSignal> observer) {
		obsevers.add(observer);
		
	}

	@Override
	public void detach(Observer<? super EdgeInitiativePushSignal> observer) {
		obsevers.remove(observer);
		
	}

	@Override
	public void notify(EdgeInitiativePushSignal signal) {
		for(Observer<? super EdgeInitiativePushSignal> observer : obsevers) {
			observer.update(signal);
		}
	}
	
	


}
